package com.hanthink.system.service.impl.pc;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.hanthink.common.exception.CustomException;
import com.hanthink.system.domain.pc.EmFaultCode;
import com.hanthink.system.mapper.EmFaultCodeMapper;
import com.hanthink.system.service.pc.IEmFaultCodeService;

/**
 * 故障代码Service业务层处理
 * 
 * @author hanthink
 * @date 2021-01-21
 */
@Service
public class EmFaultCodeServiceImpl implements IEmFaultCodeService {
	@Autowired
	private EmFaultCodeMapper emFaultCodeMapper;

	/**
	 * 查询故障代码
	 * 
	 * @param id 故障代码ID
	 * @return 故障代码
	 */
	@Override
	public EmFaultCode selectEmFaultCodeById(Long id) {
		return emFaultCodeMapper.selectEmFaultCodeById(id);
	}

	/**
	 * 查询故障代码列表
	 * 
	 * @param emFaultCode 故障代码
	 * @return 故障代码
	 */
	@Override
	public List<EmFaultCode> selectEmFaultCodeList(EmFaultCode emFaultCode) {
		return emFaultCodeMapper.selectEmFaultCodeList(emFaultCode);
	}

	/**
	 * 新增故障代码
	 * 
	 * @param emFaultCode 故障代码
	 * @return 结果
	 */
	@Override
	public int insertEmFaultCode(EmFaultCode emFaultCode) {
		
		return emFaultCodeMapper.insertEmFaultCode(emFaultCode);
	}

	/**
	 * 修改故障代码
	 * 
	 * @param emFaultCode 故障代码
	 * @return 结果
	 */
	@Override
	public int updateEmFaultCode(EmFaultCode emFaultCode) {
		return emFaultCodeMapper.updateEmFaultCode(emFaultCode);
	}

	/**
	 * 批量删除故障代码
	 * 
	 * @param ids 需要删除的故障代码ID
	 * @return 结果
	 */
	@Override
	public int deleteEmFaultCodeByIds(Long[] ids) {
	
		return emFaultCodeMapper.deleteEmFaultCodeByIds(ids);
	}

	/**
	 * 删除故障代码信息
	 * 
	 * @param id 故障代码ID
	 * @return 结果
	 */
	@Override
	public int deleteEmFaultCodeById(Long id) {
		return emFaultCodeMapper.deleteEmFaultCodeById(id);
	}
}
